package gof.com.yew.proxy.dynamicproxy;

import java.lang.reflect.Proxy;

import gof.com.yew.proxy.staticproxy.AudiCar;
import gof.com.yew.proxy.staticproxy.Movable;

public class ProxyDemo01 {
	
	public static void main(String[] args) {
		Movable audi = new AudiCar();
		System.getProperties().put("sun.misc.ProxyGenerator.saveGeneratedFiles", "true");
		ProxyHandler handler = new ProxyHandler(audi);
		Movable proxy = (Movable)Proxy.newProxyInstance(ClassLoader.getSystemClassLoader(), new Class[] {Movable.class}, handler);
		proxy.move();
	}

}
